package com.chart.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.chart.service.ChartService;
import com.chart.service.impl.ChartServiceImpl;
import com.domain.vo.MoneyVo;
import com.google.gson.Gson;
@WebServlet("/chart/money")
public class MoneyServlet extends HttpServlet {
	private ChartService chartService = new ChartServiceImpl();
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		long t1 = System.currentTimeMillis();
		req.setCharacterEncoding("utf-8");
		res.setCharacterEncoding("utf-8");
		res.setContentType("application/json;chartset=utf-8");
		String money = chartService.money();
		PrintWriter pw = res.getWriter();
		long t2 = System.currentTimeMillis();
		System.out.println( t2-t1 );
		pw.write( money );
	}
}
